gpg-verify-result: canonicalise key when looking up signatures
authorRobert McQueen <rob@endlessm.com>
Sun, 30 Jul 2017 16:35:46 +0000 (17:35 +0100)
committerAtomic Bot <atomic-devel@projectatomic.io>
Mon, 31 Jul 2017 14:37:09 +0000 (14:37 +0000)
commit156cf23576df15cfd06d8138f7fc4443bfee5058
tree08577743c4952bde963fcc2d53c69a2c6d0b2cbd
parentd7f953aa3a9fc61d7d22fd2d05ff92583cb7b21d
gpg-verify-result: canonicalise key when looking up signatures

Use gpgme_get_key to find the primary key for the key we are
looking for, and the primary key for each signature, and
compare these when looking up signatures.

The primary key is the first in the list of subkeys, which is
the normal key ID people use when referring to a GPG key as an
identity.

If the key has a signing subkey, signature->fpr will not match
the provided key_id, so looking up both keys and comparing the
primary key fingerprints ensures they are both canonicalised.

https://github.com/ostreedev/ostree/issues/608

Closes: #1036
Approved by: cgwalters
src/libostree/ostree-gpg-verify-result.c